﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using System.Reflection;
using System.Text;

namespace NSQL.Extensions
{
    public static class StringBuilderExtensions
    {
        private static FieldInfo ChunkPrevious = typeof(StringBuilder).GetRuntimeField("m_ChunkPrevious");
        public static StringBuilder Append(this StringBuilder self, StringBuilder value)
        {
            if (self is null)
            {
                return value;
            }

            // ReSharper disable once ConvertIfStatementToReturnStatement
            if (value is null)
            {
                return self;
            }

            return self.Append(value);
        }
    }
}